export default function (option: any) {
  return new Promise<void>((resolve) => {
    const duration = option.duration || 1500
    uni.showToast({
      ...option,
      duration,
    })

    const timeout = setTimeout(() => {
      clearTimeout(timeout)
      resolve()
    }, duration)
  })
}
